﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Facebook_List.aspx.cs" Inherits="FacebookApp.Facebook_List" EnableViewState="false" MasterPageFile="~/PublicInterface/Home.Master" %>
<%@ Register src="UserControl/MsgUC.ascx" tagname="MsgUC" tagprefix="uc1" %>

<asp:Content ID="cBody" ContentPlaceHolderID="cphBody" runat="server">
    <div id="divAll">
        <uc1:MsgUC ID="MsgUC1" runat="server" /><br />
        <div class="input-group">
            <asp:TextBox ID="txtUserID" runat="server" Text="567656783348735" CssClass="form-control"></asp:TextBox>
            <span class="input-group-btn"><asp:Button ID="btnShow" runat="server" Text="Show" OnClick="btnShow_Click" CssClass="btn btn-default" /></span>
        </div>
        <br />
        <asp:DropDownList ID="ddlPage" runat="server" onselectedindexchanged="ddlPage_SelectedIndexChanged" Width="300px" Visible="false" AutoPostBack="true" EnableViewState="true">
        </asp:DropDownList><br /><br />
        <asp:Panel ID="pnlDetail" runat="server" Visible="false">
            <asp:GridView ID="grvPost" runat="server" AutoGenerateColumns="false" CssClass="table table-striped table-bordered table-hover dataTable no-footer styleGrid"
                EmptyDataText="Không có dữ liệu nào thỏa mãn điều kiện tìm kiếm!" DataKeyNames="id" OnRowDataBound="grvPost_RowDataBound" Width="100%" OnPageIndexChanging="grvPost_PageIndexChanging" PageSize="20" AllowPaging="True">
                <AlternatingRowStyle CssClass="GridAlternatingItem"></AlternatingRowStyle>
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Image ID="imgComment_Show_Hide" runat="server" ImageUrl="http://www.aspsnippets.com/Demos/img/plus.png" style="cursor: pointer" Visible="false" AlternateText="Ẩn/Hiện chi tiết"/>
                            <asp:Panel ID="pnlComment" runat="server" Style="display: none">
                                <asp:GridView ID="grvComment" runat="server" AutoGenerateColumns="false" CssClass="table table-striped table-bordered table-hover dataTable no-footer styleGrid"
                                    EmptyDataText="Không có dữ liệu nào thỏa mãn điều kiện tìm kiếm!" DataKeyNames="id" OnRowDataBound="grvComment_RowDataBound" Width="100%">
                                    <AlternatingRowStyle CssClass="GridAlternatingItem"></AlternatingRowStyle>
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Image ID="imgReply_Show_Hide" runat="server" ImageUrl="http://www.aspsnippets.com/Demos/img/plus.png" style="cursor: pointer" Visible="false" AlternateText="Ẩn/Hiện chi tiết"/>
                                                <asp:Panel ID="pnlReply" runat="server" Style="display: none">
                                                    <asp:GridView ID="grvReply" runat="server" AutoGenerateColumns="false" CssClass="table table-striped table-bordered table-hover dataTable no-footer styleGrid"
                                                        EmptyDataText="Không có dữ liệu nào thỏa mãn điều kiện tìm kiếm!" DataKeyNames="id" Width="100%">
                                                        <AlternatingRowStyle CssClass="GridAlternatingItem"></AlternatingRowStyle>
                                                        <Columns>
                                                            <asp:BoundField ItemStyle-Width="100px" DataField="id" HeaderText="reply id" />
                                                            <asp:BoundField DataField="message" HeaderText="message" />
                                                            <asp:BoundField ItemStyle-Width="100px" DataField="like_count" HeaderText="like count" />
                                                        </Columns>
				                                        <PagerStyle CssClass="numberpagestyle" />
				                                        <HeaderStyle CssClass="headerpagestyle" BackColor="#7CB0E8" />
                                                    </asp:GridView>
                                                </asp:Panel>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField ItemStyle-Width="100px" DataField="id" HeaderText="comment id" />
                                        <asp:BoundField DataField="message" HeaderText="message" />
                                        <asp:BoundField ItemStyle-Width="100px" DataField="like_count" HeaderText="like count" />
                                        <asp:BoundField ItemStyle-Width="160px" DataField="comment_count" HeaderText="comment count" />
                                    </Columns>
				                    <PagerStyle CssClass="numberpagestyle" />
				                    <HeaderStyle CssClass="headerpagestyle" BackColor="#B7D2EF" />
                                </asp:GridView>
                            </asp:Panel>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField ItemStyle-Width="100px" DataField="id" HeaderText="post id" />
                    <asp:BoundField DataField="message" HeaderText="message" />
                </Columns>
				<PagerStyle CssClass="numberpagestyle" />
				<HeaderStyle CssClass="headerpagestyle" BackColor="#CFD3DE" />
            </asp:GridView>
        </asp:Panel>
        <script type="text/javascript">
            $('body').on('click', '[src*=plus]', function () {
                $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>")
                $(this).attr("src", "http://www.aspsnippets.com/Demos/img/minus.png");
            });
            $('body').on("click", "[src*=minus]", function () {
                $(this).attr("src", "http://www.aspsnippets.com/Demos/img/plus.png");
                $(this).closest("tr").next().remove();
            });
        </script>
    </div>
</asp:Content>